using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class dc_materialMap : EntityTypeConfiguration<dc_material>
    {
        public dc_materialMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.MaterialCode)
                .HasMaxLength(50);

            this.Property(t => t.Chartcode)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("dc_material");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Color).HasColumnName("Color");
            this.Property(t => t.MaterialCode).HasColumnName("MaterialCode");
            this.Property(t => t.Chartcode).HasColumnName("Chartcode");
        }
    }
}
